VERSION 5.00 Begin VB.Form Form1 Caption = "Form1" ClientHeight = 4515 ClientLeft = 60 ClientTop = 345 ClientWidth = 6720 LinkTopic = "Form1" ScaleHeight = 4515 ScaleWidth = 6720 StartUpPosition = 3 'Windows Default Begin VB.CommandButton Command1 Caption = "Make List" Height = 855 Left = 3600 TabIndex = 0 Top = 960 Width = 2295 End Begin VB.Label Label1 Height = 3735 Left = 120 TabIndex = 1 Top = 240 Width = 3135 End End Attribute VB_Name = "Form1" Attribute VB_GlobalNameSpace = False Attribute VB_Creatable = False Attribute VB_PredeclaredId = True Attribute VB_Exposed = False Private Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long Private Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long Private Const DRIVE_REMOVABLE = 2 Private Const DRIVE_FIXED = 3 Private Const DRIVE_REMOTE = 4 Private Const DRIVE_CDROM = 5 Private Const DRIVE_RAMDISK = 6 Private Sub Command1_Click() Dim DriveList As String * 104 Dim LengthOfString As Long Dim CurrentDrive As String * 3 Dim CurrentDriveType As Long LengthOfString = GetLogicalDriveStrings(104, DriveList) 'It returns the length of the string Label1 = "" For i = 1 To LengthOfString / 4 CurrentDrive = Mid$(DriveList, 1 + (i - 1) * 4, 3) CurrentDriveType = GetDriveType(CurrentDrive) Label1 = Label1 & CurrentDrive & Space(5) Select Case CurrentDriveType Case DRIVE_REMOVABLE Label1 = Label1 & "Removable Drive" Case DRIVE_FIXED Label1 = Label1 & "Hard Disk Drive" Case DRIVE_REMOTE Label1 = Label1 & "Network Drive" Case DRIVE_CDROM Label1 = Label1 & "CD-ROM" Case DRIVE_RAMDISK Label1 = Label1 & "RAM Drive" End Select Label1 = Label1 & Chr(10) & Chr(13) Next End Sub